import axios from '../request';

interface Comment {
  id: number;
  content: string;
  showpieceId: number;
  projectId: number | string;
}
interface CommentPage {
  AuditStatus?: number | string; //
  CommentStatus?: number | string; //
  ShowpieceId?: number | string; //展品主键
  ProjectId?: number | string; //项目主键
  value?: string; //关键字
  pageNo: number | string;
  pageSize: number | string;
}
// 保存配置数据
export const addComment = (data: Comment) => {
  return axios.post<any>(`api/comment`, data);
};
export const commentList = (data: CommentPage) => {
  return axios.get<any>(`api/comment/list`, data);
};
export const myCommentList = (data: CommentPage) => {
  return axios.get<any>(`api/comment/my`, data);
};
interface Reply {
  value: number;
  text: string;
}
export const commentReply = (data: Reply) => {
  //回复
  return axios.post<any>(`api/comment/reply`, data);
};
export const delComment = (id: number) => {
  //删除
  return axios.delete<any>(`api/comment/${id}`, {});
};
export const approvedComment = (id: number) => {
  //审核通过
  return axios.put<any>(`api/comment/published/${id}`, {});
};
export const rejectedComment = (id: number) => {
  //审核驳回
  return axios.put<any>(`api/comment/rejected/${id}`, {});
};
